<section class="content-header">
    <h1>
        IPPI Admin Page
        <small>Donation</small>
    </h1>
</section>
<!-- Main content -->
<section class="content">
    <div class="loading">Loading&#8230;</div>
    <div class="row">
        <div class="col-md-12">
            <div id="msg" class="alert alert-danger alert-dismissable">
                <i class="fa fa-ban"></i>
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">�</button>
                <b>Alert!</b> Danger alert preview. This alert is dismissable. A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart.
            </div>
        </div>
        <div class="col-md-6">
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">Detail Donation</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                    <table class="table table-bordered">
                        <tr>
                            <th>Member </th>
                            <th>Jumlah </th>
                            <th>Tanggal </th>
                            <th class="text-center">Status </th>
                            <th class="text-center">Action </th>
                        </tr>
                        <?php 
                        $status = "";
                        foreach($list_data as $r):
                        ?>
                        <tr>
                                <td><?php echo $r->name;?></td>
                                <td><?php echo number_format($r->jumlah_donasi);?></td>
                                <td>
                                    <?php
                                    $newDate = date("d M Y <b>h:m:s<b>", strtotime($r->datecreated));
                                    echo $newDate;
                                    ?>
                                </td>
                                <td class="text-center" id="status">
                                    <?php
                                    $status = $r->status;
                                    if($r->status == 1){
                                        ?><span class="text-yellow"><b>Confirmed</b></span><?php
                                    }
                                    elseif($r->status == 2){
                                        ?>
                                        <span class="text-green">Processed</span>
                                            <?php
                                    }
                                    else{
                                        ?><span class="text-yellow">Pending</span><?php
                                    }
                                    ?>
                                </td>
                                <td class="text-center" id="action">
                                    <?php
                                        $status = $r->status;
                                        if($r->status == 1){
                                            ?>
                                    <a class="btn btn-xs btn-primary" id="process" href="<?php echo base_url("admin_donation/process/".$r->id_donasi);?>" data-id="<?php echo $r->id_donasi;?>">Process</a>
                                                <?php
                                        }
                                        else{
                                            ?> - <?php
                                        }
                                    ?>
                                </td>
                            </tr>    
                        <?php
                        endforeach;?>
                        
                    </table>
                </div><!-- /.box-body -->
            </div><!-- /.box -->
        </div><!-- /.col -->
    </div><!-- /.row -->
    <?php
    if($status == 1){
    ?>
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-header">
                    <h3 class="box-title">Detail Confirmation Donation</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                    <table class="table table-bordered">
                        <tr>
                            <th>Jumlah </th>
                            <th class="text-center">Tanggal </th>
                            <th>Cara Pembayaran </th>
                            <th>Bank Asal</th>
                            <th>No Rek Asal</th>
                            <th>Bank Tujuan</th>
                            <th>Ket</th>
                        </tr>
                        <?php 
                        foreach($list_confirm as $r):
                        ?>
                        <tr>
                            <td class="text-right">
                                <div class="pull-left">
                                    Rp.
                                </div>
                                <div class="pull-right">
                                    <?php echo number_format($r->jumlah_donasi);?>
                                </div>
                            </td>
                            <td class="text-center">
                                <?php
                                $newDate = date("d M Y <b>h:m:s<b>", strtotime($r->datecreated));
                                echo $newDate;
                                ?>
                            </td>
                            <td><?php echo $r->cara_donasi;?></td>
                            <td><?php echo $r->bank_asal;?></td>
                            <td><?php echo $r->rekening_asal;?></td>
                            <td><?php echo $r->bank_tujuan;?></td>
                            <td><?php echo $r->keterangan;?></td>
                        </tr>    
                        <?php
                        endforeach;?>
                        
                    </table>
                </div><!-- /.box-body -->
            </div><!-- /.box -->
        </div>
    </div>
    <?php
    }
    ?>
    <a class="btn btn-default btn-flat" href="<?php echo base_url("admin_donation")?>"><i class="fa fa-angle-left"></i>&nbsp;Kembali</a>
</section>